<?php 
$qva_menu_name = 'qva-menu';
?>

<!--menu start-->
    <div class="menu">
        <div class="navbar-wrapper stuckMenu <?php if (!qva_is_static_page()) echo ' nav-bar-blog  isStuck';  ?>">
            <div class="container">
                <div class="navwrapper">
                    <div class="navbar navbar-inverse navbar-static-top" >
                        <div class="container">
                            <?php 
                                $logoType =   isset(qvaCore::$qvaOptions['logo']['type']) ? qvaCore::$qvaOptions['logo']['type'] : 'upload';

                             if ($logoType == 'text') :
                            ?>
                            <div class="logo_text"><a href="<?php echo home_url(); ?>" style="color:<?php echo isset(qvaCore::$qvaOptions['logo']['logo_color']) && !empty(qvaCore::$qvaOptions['logo']['logo_color']) ? qvaCore::$qvaOptions['logo']['logo_color'] : '#fff';  ?>"><?php echo isset(qvaCore::$qvaOptions['logo']['text']) ? stripslashes(qvaCore::$qvaOptions['logo']['text']) : 'QVA'; ?></a></div>
                            <?php 
                            else :
                                $logoUrl = isset(qvaCore::$qvaOptions['logo']['upload']) ? stripslashes(qvaCore::$qvaOptions['logo']['upload']) : get_template_directory_uri() . '/images/logo-2.png';
                            ?>
                            <div class="logo" style="background:url('<?php echo $logoUrl ?>') no-repeat 0 0;">
                            </div>
                            <?php 
                            endif;  
                            ?>
                            <div class="navArea">
                                <div class="navbar-header">
                                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>
                                    <a class="navbar-brand" href="#">Menu</a> </div>
                                    <div class="navbar-collapse collapse">
                                        <ul class="nav navbar-nav">
                                            <?php 
                                            	if ( ( $qva_locations = get_nav_menu_locations() ) && isset( $qva_locations[ $qva_menu_name ] ) ) 
    												{
    													$menu = wp_get_nav_menu_object( $qva_locations[ $qva_menu_name ] );

    													$menu_items = wp_get_nav_menu_items($menu->term_id);
    													
    													foreach ( (array) $menu_items as $key => $menu_item ) 
    													{
    													    $title[] = $menu_item->title;
    													    $url[] = $menu_item->url;
    													    $type[] = $menu_item->object;
    													}

    													if ( !empty($url) )
    													{
    														$homeUrl = !qva_is_static_page() ? site_url('/')  : '';
                                                            ?>
    															<!-- <ul class="rs clearfix"> -->
    																<?php if ( qva_is_static_page() ) : ?>
                                                                    <li class="menuItem"><a href="#banner">Home</a></li>
    																<?php 
                                                                        endif;
                                                                        foreach ($type as $k => $v) : 
                                                                            if ( $v == 'custom' ) :
    																?>
    															 	<li class="menuItem"><a href="<?php echo $homeUrl .  $url[$k] ?>"><?php echo $title[$k] ?></a></li>    
                                                                    <?php
                                                                        else : 
                                                                        ?>
                                                                        <li class="menuItem"><a href="<?php echo  $url[$k] ?>"><?php echo $title[$k] ?></a></li>  
                                                                        <?php 
                                                                        endif;
                                                                    ?>
    																<?php endforeach; ?>
    															<!-- </ul> -->
    														<?php 
    													}
    												}	
                                            ?>
                                        </ul>
                                    </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- End Navbar -->
            </div>
        </div>
    </div>
<!--menu end-->
<?php         




